package com.example.sunmiv1.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * 序列化之後進行深拷貝
 */
public class SkuInfoNew implements Parcelable {

    /**
     * status : 1
     * data : [{"id":"159","name":"口味","list":[{"id":"298","name":"麻辣","checked":false},{"id":"299","name":"原味","checked":false},{"id":"300","name":"燒烤","checked":false},{"id":"327","name":"學習","checked":false},{"id":"328","name":"九分","checked":false},{"id":"329","name":"八分","checked":false},{"id":"330","name":"七分","checked":false},{"id":"331","name":"六分","checked":false},{"id":"332","name":"五分","checked":false},{"id":"333","name":"四份","checked":false},{"id":"334","name":"三分","checked":false},{"id":"335","name":"二分","checked":false},{"id":"336","name":"一分","checked":false},{"id":"395","name":"香辣","checked":false},{"id":"470","name":"3","checked":false},{"id":"495","name":"靈籠","checked":false},{"id":"496","name":"急急急","checked":false},{"id":"497","name":"165","checked":false},{"id":"498","name":"166","checked":false},{"id":"499","name":"167","checked":false},{"id":"500","name":"168","checked":false},{"id":"501","name":"169","checked":false},{"id":"502","name":"170","checked":false},{"id":"503","name":"171","checked":false},{"id":"504","name":"172","checked":false},{"id":"505","name":"173","checked":false},{"id":"508","name":"魷魚","checked":false},{"id":"509","name":"黑胡椒","checked":false},{"id":"544","name":"","checked":false},{"id":"547","name":"發的發個","checked":false},{"id":"549","name":"牛油果","checked":false},{"id":"550","name":"草莓","checked":false},{"id":"551","name":"水蜜桃","checked":false},{"id":"555","name":"甜","checked":false},{"id":"556","name":"分","checked":false},{"id":"557","name":"世界世界級","checked":false},{"id":"558","name":"爲了DLL","checked":false},{"id":"559","name":"頂頂頂","checked":false}],"checked":false},{"id":"160","name":"尺寸","list":[{"id":"301","name":"x","checked":false},{"id":"302","name":"l","checked":false},{"id":"303","name":"xl","checked":false},{"id":"304","name":"xxl","checked":false},{"id":"305","name":"xxxl","checked":false},{"id":"337","name":"xxs","checked":false},{"id":"338","name":"xs","checked":false},{"id":"339","name":"s","checked":false},{"id":"340","name":"m","checked":false},{"id":"341","name":"xll","checked":false},{"id":"386","name":"48","checked":false},{"id":"387","name":"50","checked":false},{"id":"388","name":"52","checked":false},{"id":"389","name":"54","checked":false},{"id":"393","name":"55","checked":false},{"id":"515","name":"西葫蘆","checked":false}],"checked":false},{"id":"161","name":"溫度","list":[{"id":"306","name":"加冰","checked":false},{"id":"308","name":"甜度","checked":false},{"id":"311","name":"xl","checked":false}],"checked":false},{"id":"163","name":"甜度","list":[{"id":"309","name":"三分甜","checked":false},{"id":"310","name":"七分甜","checked":false},{"id":"313","name":"純甜","checked":false},{"id":"315","name":"微甜","checked":false},{"id":"317","name":"酸甜","checked":false},{"id":"510","name":"不甜","checked":false},{"id":"511","name":"苦","checked":false},{"id":"512","name":"賊苦","checked":false},{"id":"513","name":"三分苦","checked":false},{"id":"514","name":"七分苦","checked":false},{"id":"545","name":"","checked":false},{"id":"548","name":"一分","checked":false}],"checked":false},{"id":"164","name":"重量","list":[{"id":"312","name":"250g","checked":false},{"id":"314","name":"550g","checked":false},{"id":"316","name":"750g","checked":false},{"id":"546","name":"","checked":false}],"checked":false},{"id":"165","name":"個","list":[{"id":"318","name":"4個","checked":false},{"id":"319","name":"6個","checked":false},{"id":"322","name":"個","checked":false},{"id":"350","name":"12","checked":false}],"checked":false},{"id":"166","name":"支","list":[{"id":"320","name":"1支","checked":false},{"id":"367","name":"10支","checked":false},{"id":"368","name":"12支","checked":false}],"checked":false},{"id":"167","name":"件","list":[{"id":"321","name":"件","checked":false}],"checked":false},{"id":"168","name":"大小","list":[{"id":"323","name":"s","checked":false},{"id":"324","name":"m","checked":false},{"id":"342","name":"xxs","checked":false},{"id":"343","name":"xs","checked":false},{"id":"344","name":"l","checked":false},{"id":"345","name":"x","checked":false},{"id":"346","name":"xl","checked":false},{"id":"347","name":"xll","checked":false},{"id":"348","name":"xlll","checked":false},{"id":"349","name":"xxlll","checked":false},{"id":"398","name":"定製大碼xxxl","checked":false},{"id":"399","name":"定製小碼","checked":false},{"id":"402","name":"162","checked":false}],"checked":false},{"id":"169","name":"尺寸2","list":[{"id":"325","name":"S","checked":false},{"id":"326","name":"M","checked":false}],"checked":false},{"id":"170","name":"顏色","list":[{"id":"385","name":"K8","checked":false},{"id":"390","name":"Z3","checked":false},{"id":"477","name":"紅","checked":false},{"id":"478","name":"黃","checked":false}],"checked":false},{"id":"171","name":"分量","list":[{"id":"552","name":"100ml","checked":false},{"id":"553","name":"150ml","checked":false},{"id":"554","name":"200ml","checked":false}],"checked":false},{"id":"172","name":"材質","list":[{"id":"351","name":"不鏽鋼","checked":false},{"id":"352","name":"鐵","checked":false},{"id":"353","name":"銅","checked":false}],"checked":false},{"id":"174","name":"lal","list":[{"id":"355","name":"x1","checked":false},{"id":"356","name":"x2","checked":false},{"id":"381","name":"3","checked":false}],"checked":false},{"id":"192","name":"折射率","list":[{"id":"424","name":"1.56","checked":false},{"id":"454","name":"1.6","checked":false}],"checked":false},{"id":"193","name":"球鏡","list":[{"id":"425","name":"0","checked":false},{"id":"427","name":"-0.25","checked":false},{"id":"428","name":"-0.5","checked":false},{"id":"429","name":"-0.75","checked":false},{"id":"430","name":"-1","checked":false},{"id":"431","name":"-1.25","checked":false},{"id":"432","name":"-1.5","checked":false},{"id":"433","name":"-1.75","checked":false},{"id":"434","name":"-2","checked":false},{"id":"435","name":"-2.25","checked":false},{"id":"436","name":"-2.5","checked":false},{"id":"437","name":"-2.75","checked":false},{"id":"438","name":"-3","checked":false},{"id":"439","name":"-3.25","checked":false},{"id":"440","name":"-3.5","checked":false},{"id":"441","name":"-3.75","checked":false},{"id":"442","name":"-4","checked":false},{"id":"443","name":"-4.25","checked":false},{"id":"444","name":"-4.5","checked":false},{"id":"445","name":"-4.75","checked":false},{"id":"446","name":"-5","checked":false},{"id":"455","name":"-5.25","checked":false},{"id":"456","name":"-5.5","checked":false},{"id":"457","name":"-5.75","checked":false},{"id":"458","name":"-6","checked":false},{"id":"459","name":"-6.25","checked":false},{"id":"460","name":"-6.5","checked":false},{"id":"461","name":"-6.75","checked":false},{"id":"462","name":"-7","checked":false},{"id":"463","name":"-7.25","checked":false},{"id":"464","name":"-7.5","checked":false},{"id":"465","name":"-7.75","checked":false},{"id":"466","name":"-8","checked":false},{"id":"467","name":"-8.25","checked":false},{"id":"468","name":"-8.5","checked":false},{"id":"469","name":"-8.75","checked":false}],"checked":false},{"id":"194","name":"柱鏡","list":[{"id":"426","name":"0","checked":false},{"id":"447","name":"-0.5","checked":false},{"id":"448","name":"-0.75","checked":false},{"id":"449","name":"-1","checked":false},{"id":"450","name":"-1.25","checked":false},{"id":"451","name":"-1.5","checked":false},{"id":"452","name":"-1.75","checked":false},{"id":"453","name":"-2","checked":false}],"checked":false},{"id":"195","name":"糖","list":[],"checked":false},{"id":"196","name":"苦","list":[{"id":"471","name":"1分","checked":false},{"id":"472","name":"3分","checked":false},{"id":"473","name":"三分","checked":false},{"id":"476","name":"1","checked":false}],"checked":false},{"id":"197","name":"辣","list":[{"id":"474","name":"1分","checked":false},{"id":"475","name":"2分","checked":false}],"checked":false},{"id":"198","name":"L","list":[{"id":"479","name":"150","checked":false},{"id":"480","name":"300","checked":false}],"checked":false},{"id":"200","name":"S","list":[{"id":"481","name":"10","checked":false},{"id":"482","name":"20S","checked":false},{"id":"483","name":"30S","checked":false}],"checked":false},{"id":"203","name":"五香","list":[{"id":"492","name":"1","checked":false},{"id":"493","name":"一","checked":false}],"checked":false},{"id":"204","name":"寶寶了","list":[{"id":"494","name":"阿拉蕾","checked":false}],"checked":false},{"id":"205","name":"1","list":[],"checked":false},{"id":"206","name":"2","list":[{"id":"506","name":"1","checked":false},{"id":"507","name":"23","checked":false}],"checked":false},{"id":"207","name":"西葫蘆","list":[{"id":"516","name":"530","checked":false},{"id":"517","name":"460","checked":false}],"checked":false},{"id":"209","name":"3","list":[{"id":"518","name":"30","checked":false},{"id":"519","name":"34","checked":false},{"id":"520","name":"33","checked":false},{"id":"521","name":"31","checked":false},{"id":"522","name":"32","checked":false}],"checked":false},{"id":"210","name":"y","list":[{"id":"526","name":"","checked":false},{"id":"527","name":"1","checked":false}],"checked":false},{"id":"211","name":"w","list":[{"id":"525","name":"t","checked":false}],"checked":false},{"id":"212","name":"by","list":[],"checked":false},{"id":"213","name":"44","list":[],"checked":false},{"id":"214","name":"4","list":[],"checked":false},{"id":"215","name":"5","list":[],"checked":false},{"id":"216","name":"6","list":[],"checked":false},{"id":"217","name":"h","list":[],"checked":false},{"id":"218","name":"gh","list":[],"checked":false},{"id":"222","name":"一分","list":[],"checked":false},{"id":"223","name":"甜","list":[],"checked":false}]
     */

    private int status;
    private List<DataBean> data;
    private int SelectFlag=0;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public int getSelectFlag() {
        return SelectFlag;
    }

    public void setSelectFlag(int selectFlag) {
        SelectFlag = selectFlag;
    }

    public static class DataBean implements Parcelable {// 規格種類
        /**
         * id : 159
         * name : 口味
         * list : [{"id":"298","name":"麻辣","checked":false},{"id":"299","name":"原味","checked":false},{"id":"300","name":"燒烤","checked":false},{"id":"327","name":"學習","checked":false},{"id":"328","name":"九分","checked":false},{"id":"329","name":"八分","checked":false},{"id":"330","name":"七分","checked":false},{"id":"331","name":"六分","checked":false},{"id":"332","name":"五分","checked":false},{"id":"333","name":"四份","checked":false},{"id":"334","name":"三分","checked":false},{"id":"335","name":"二分","checked":false},{"id":"336","name":"一分","checked":false},{"id":"395","name":"香辣","checked":false},{"id":"470","name":"3","checked":false},{"id":"495","name":"靈籠","checked":false},{"id":"496","name":"急急急","checked":false},{"id":"497","name":"165","checked":false},{"id":"498","name":"166","checked":false},{"id":"499","name":"167","checked":false},{"id":"500","name":"168","checked":false},{"id":"501","name":"169","checked":false},{"id":"502","name":"170","checked":false},{"id":"503","name":"171","checked":false},{"id":"504","name":"172","checked":false},{"id":"505","name":"173","checked":false},{"id":"508","name":"魷魚","checked":false},{"id":"509","name":"黑胡椒","checked":false},{"id":"544","name":"","checked":false},{"id":"547","name":"發的發個","checked":false},{"id":"549","name":"牛油果","checked":false},{"id":"550","name":"草莓","checked":false},{"id":"551","name":"水蜜桃","checked":false},{"id":"555","name":"甜","checked":false},{"id":"556","name":"分","checked":false},{"id":"557","name":"世界世界級","checked":false},{"id":"558","name":"爲了DLL","checked":false},{"id":"559","name":"頂頂頂","checked":false}]
         * checked : false
         */

        private String id;
        private String name;
        private boolean checked;
        private List<ListBean> list;

        public DataBean(String id, String name, boolean checked, List<SkuInfoNew.DataBean.ListBean> list) {
            this.id = id;
            this.name = name;
            this.checked = checked;
            this.list = list;
        }


        public String getId() {
            return id == null ? "" : id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getName() {
            return name == null ? "" : name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public boolean isChecked() {
            return checked;
        }

        public void setChecked(boolean checked) {
            this.checked = checked;
        }

        public List<ListBean> getList() {
            if (list == null) {
                return new ArrayList<>();
            }
            return list;
        }

        public void setList(List<ListBean> list) {
            this.list = list;
        }

        public static Creator<DataBean> getCREATOR() {
            return CREATOR;
        }

        public static class ListBean implements Parcelable {// 規格名稱
            /**
             * id : 298
             * name : 麻辣
             * checked : false
             */

            private String id;
            private String name;
            private boolean checked;

            public ListBean(String id, String name, boolean checked) {
                this.id = id;
                this.name = name;
                this.checked = checked;
            }


            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public boolean isChecked() {
                return checked;
            }

            public void setChecked(boolean checked) {
                this.checked = checked;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(this.id);
                dest.writeString(this.name);
                dest.writeByte(this.checked ? (byte) 1 : (byte) 0);
            }

            protected ListBean(Parcel in) {
                this.id = in.readString();
                this.name = in.readString();
                this.checked = in.readByte() != 0;
            }

            public static final Creator<ListBean> CREATOR = new Creator<ListBean>() {
                @Override
                public ListBean createFromParcel(Parcel source) {
                    return new ListBean(source);
                }

                @Override
                public ListBean[] newArray(int size) {
                    return new ListBean[size];
                }
            };
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.name);
            dest.writeByte(this.checked ? (byte) 1 : (byte) 0);
            dest.writeList(this.list);
        }

        protected DataBean(Parcel in) {
            this.id = in.readString();
            this.name = in.readString();
            this.checked = in.readByte() != 0;
            this.list = new ArrayList<ListBean>();
            in.readList(this.list, ListBean.class.getClassLoader());
        }

        public static final Creator<DataBean> CREATOR = new Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel source) {
                return new DataBean(source);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.status);
        dest.writeList(this.data);
        dest.writeInt(this.SelectFlag);
    }

    public SkuInfoNew() {
    }

    protected SkuInfoNew(Parcel in) {
        this.status = in.readInt();
        this.data = new ArrayList<DataBean>();
        in.readList(this.data, DataBean.class.getClassLoader());
        this.SelectFlag = in.readInt();
    }

    public static final Parcelable.Creator<SkuInfoNew> CREATOR = new Parcelable.Creator<SkuInfoNew>() {
        @Override
        public SkuInfoNew createFromParcel(Parcel source) {
            return new SkuInfoNew(source);
        }

        @Override
        public SkuInfoNew[] newArray(int size) {
            return new SkuInfoNew[size];
        }
    };
}
